package com.dk.service.impl;

import com.dk.mapper.TbAccidentMapper;
import com.dk.pojo.TbAccident;
import com.dk.service.TbAccidentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TbAccidentServiceImpl implements TbAccidentService {


    @Autowired
    private TbAccidentMapper accidentMapper;

    @Override
    public List<TbAccident> selectAll() {
        return accidentMapper.selectList(null);
    }

    @Override
    public TbAccident getAccidentsById(String instrumentId) {
        return accidentMapper.selectById(instrumentId);
    }

    @Override
    public void addAccidents(TbAccident accident) {
        accidentMapper.insert(accident);
    }

    @Override
    public void updateAccidentById(TbAccident accident) {
        accidentMapper.updateById(accident);
    }

    @Override
    public void deleteAccidentById(String instrumentId) {
        accidentMapper.deleteById(instrumentId);
    }
}
